package com.atguigu.day11.exer.e2;

/**
 * @version 1.0
 * @Author 马冰
 * @Date 2024/11/12 13:41
 * @注释
 */
public class HourEmployee extends Employee{
    private double hours;
    private double salary;

    public HourEmployee(String name, double hours, double salary) {
        super(name);
        this.hours = hours;
        this.salary = salary;
    }

    public double earning(){
        return hours*salary;
    }

    @Override
    public String toString() {
        return super.toString() + ", 工作小时数：" + hours;
    }
}
